﻿namespace Maltose.Data
{
    /// <summary>
    /// 分页参数接口
    /// </summary>
    public interface ISqlPage
    {

    }

    /// <summary>
    /// 分页页码
    /// </summary>
    public interface ISqlPageNumber : ISqlPage
    {
        /// <summary>
        /// 当前第几页
        /// <para>默认1</para>
        /// </summary>
        int PageIndex { get; set; }

        /// <summary>
        /// 每页分多少条数据
        /// <para>默认10条</para>
        /// </summary>
        int PageSize { get; set; }
    }

    /// <summary>
    /// 使用自定义 T-SQL语句
    /// </summary>
    public interface ICustomTSQLPage : ISqlPageNumber
    {
        /// <summary>
        /// sql语句
        /// </summary>
        string Sql { get; set; }

        /// <summary>
        /// 利用什么字段分页
        /// </summary>
        string KeyFiled { get; set; }

        /// <summary>
        /// 条件参数 键值对
        /// </summary>
        SqlPageString Where { get; set; }
    }

    /// <summary>
    /// 正常分页接口
    /// </summary>
    public interface ISqlNormalPage : ISqlPageNumber
    {
        /// <summary>
        /// 表名
        /// </summary>
        string TableName { get; set; }

        /// <summary>
        /// 需要显示的字段
        /// </summary>
        string ShowField { get; set; }

        /// <summary>
        /// 利用什么字段分页
        /// </summary>
        string KeyFiled { get; set; }

        /// <summary>
        /// 字段排序
        /// </summary>
        string OrderBy { get; set; }

        /// <summary>
        /// 条件
        /// </summary>
        SqlPageString Where { get; set; }
    }
}
